package cz.semjob.learning.data;

import java.util.List;

import cz.semjob.document.annotation.metadata.Relation;
import cz.semjob.learning.instances.LabeledRelationInstance;
import cz.semjob.learning.relation.IRelationInstanceCreator;

public class RelationDataSetCollector {

	private IRelationInstanceCreator relationInstanceCreator;

	private RelationDataSet dataSet;

	public RelationDataSetCollector(String name,
			IRelationInstanceCreator relationInstanceCreator,
			List<Relation> relations) {
		this.relationInstanceCreator = relationInstanceCreator;
		dataSet = new RelationDataSet(name, relations);
		dataSet.setAttributesList(relationInstanceCreator.getListOfAttributes());
	}

	public void addInstances(List<LabeledRelationInstance> instances,
			Relation relation) {
		dataSet.addPositiveInstances(instances, relation);
	}

	public RelationDataSet getDataSet() {
		return dataSet;
	}

	public IRelationInstanceCreator getTextInstanceCreator() {
		return relationInstanceCreator;
	}

	public void setTextInstanceCreator(
			IRelationInstanceCreator textInstanceCreator) {
		this.relationInstanceCreator = textInstanceCreator;
	}

	public int getPositiveInstancesSize() {
		return dataSet.getPositiveInstancesSize();
	}

	// public int getNegativeInstancesSize() {
	// return dataSet.getNegativeInstancesSize();
	// }

}
